<template>
	<view class="mainpadding2">
		<view class="flexcenter" v-if="!list.data.length">
			<view class="placeholderimage" style="margin-top: 300rpx;" ></view>
		</view>
		<view class="flexbetween flex_wrap" v-else>
			<view class="mainpadding2s ffffff radius wushi margin_top"  v-for="item in list.data" :key="item.id" @click="tzspxq(item.id)">
				<view class="shilitu">
					<image :src="item.image_text" mode=""></image>
				</view>
				<view class="margin_top2 xiaohei fonweight sanshier xiankuan">{{item.name}}</view>
				<view class="xiaohong bigtext margin_top1">{{item.price}}</view>
				<view class="xiaolanbtn margin_top1">抢购</view>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				page: 1,
				limit: 12,
				list: {
					data: []
				},
				listid:""
			}
		},
		onLoad(options) {
			this.listid = options.id
			// this.init()
		},
		onShow() {
			this.init()
		},
		methods: {
			init(isPage, page) { //提现记录
				let _this = this
				let url = "/api/cccl/ccGoodsIndex"
				let data = {
					page: page || 1,
					limit: _this.limit,
					cc_id:this.listid
				}
				httpRequest.request(url, 'GET', data, false, false, true).then(res => {
					if (res.code == 1) {
						let resList = res.data;
						let dataList = _this.list;
						if (isPage == true) {
							_this.list.data = dataList.data.concat(resList.data);
						} else {
							this.list = res.data
							_this.list.data = resList.data;
							this.pageShow = true
						}
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			onReachBottom() {
				let _this = this;
				let list = _this.list;
				let page = _this.page;
				if (list.last_page <= page) {
					return false;
				}
				page++;
				_this.page = page;
				_this.init(true, page);
			},
			// 跳转商品详情
			tzspxq(id) {
				uni.navigateTo({
					url: '/pages/homepage/shangpxqftc?id='+id+"&cc_id="+this.listid
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.wushi {
		width: 43%;
	}

	.xiaolanbtn {
		width: 140rpx;
		height: 60rpx;
		color: #fff;
		background-color: #3478f5;
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 30rpx;
		font-size: 32rpx;
	}

	.shilitu {
		width: 100%;
		height: 250rpx;

		image {
			width: 100%;
			height: 100%;
		}
	}
</style>




<!-- <template>
	<view class="mainpadding">
		<view class="mainpadding ffffff radius shangj" v-for="item in 6" @click="tzspxq">
			<view class="flexbetween">
				<view class="bigtext fonweight xiaohei">叶猴</view>
				<view class="flexleft">
					<view class="xiaolan sanshier fonweight margin_right1">飞天场</view>
					<view class="xiaolan sanshier fonweight"> 上架</view>
				</view>
			</view>
			<view class="margin_top2 flexbetween">
				<view class="shilitu">
					<image src="../../static/image/sysem/ftc.png" mode=""></image>
				</view>
				<view class="" style="width: 66%;">
					<view class="xiaohui titletext nofonweight">库号：122555</view>
					<view class="xiaohui titletext nofonweight margin_top1">上牌日期：122555</view>
					<view class="xiaohui titletext nofonweight margin_top1">买入价：
						<text class="xiaohong titletext fonweight">100</text>
					</view>
					<view class="xiaohui titletext nofonweight margin_top1">卖出价：
						<text class="xiaohong titletext fonweight">100</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>

	const httpRequest = require("@/common/httpRequest.js")

	export default {
		data() {
			return {

			}
		},
		methods: {
			//  跳转商品详情
			tzspxq() {
				uni.navigateTo({
					url: '/pages/homepage/shangpxqftc'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.shilitu {
		width: 190rpx;
		height: 180rpx;
		border-radius: 20rpx;

		image {
			border-radius: 20rpx;
			width: 100%;
			height: 100%;
		}
	}

	.shangj {
		margin-top: 30rpx;
	}

	.shangj:first-child {
		margin-top: 0rpx;
	}
</style> -->